package com.hutao.manage.model;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 临时医嘱信息
 * @author lyh
 *
 */
public class HospitalVisitDoctorAdviceTemporaryInfo {

	/**
	 * visitGuid
	 */
	private String visitGuid;
	
	/**
	 * 临时医嘱记录集合
	 */
	private List<HospitalVisitDoctorAdviceTemporaryRecord> doctorAdviceTemporaryRecords = new ArrayList<HospitalVisitDoctorAdviceTemporaryRecord>();

	@JsonIgnore
	public void clearEmpty(){
		for (int i = this.doctorAdviceTemporaryRecords.size()-1; i >=0; i--) {
			HospitalVisitDoctorAdviceTemporaryRecord doctorAdviceTemporaryRecord = this.doctorAdviceTemporaryRecords.get(i);
			doctorAdviceTemporaryRecord.clearEmpty();
			if(doctorAdviceTemporaryRecord.isEmpty()){
				
				if(doctorAdviceTemporaryRecord.getDoctorAdviceTemporaryItems().size() == 0){
					this.doctorAdviceTemporaryRecords.remove(i);
				}
				
			}
		}
	}
	
	public String getVisitGuid() {
		return visitGuid;
	}

	public void setVisitGuid(String visitGuid) {
		this.visitGuid = visitGuid;
	}

	public List<HospitalVisitDoctorAdviceTemporaryRecord> getDoctorAdviceTemporaryRecords() {
		return doctorAdviceTemporaryRecords;
	}

	public void setDoctorAdviceTemporaryRecords(
			List<HospitalVisitDoctorAdviceTemporaryRecord> doctorAdviceTemporaryRecords) {
		this.doctorAdviceTemporaryRecords = doctorAdviceTemporaryRecords;
	}
	
	
}
